//
//  QRCodeScanViewController.m
//  NiuNiuPacking
//
//  Created by Janny on 14-10-1.
//  Copyright (c) 2014年 Reseek. All rights reserved.
//

#import "QRCodeScanViewController.h"

@interface QRCodeScanViewController ()


@end

@implementation QRCodeScanViewController

@synthesize QRCodeReaderView;
@synthesize QRCode;

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //the delegate receives decode results;
   // QRCodeReaderView.readerDelegate = self;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void) viewDidAppear:(BOOL)animated{
    //run the reader when the view is visible
    [QRCodeReaderView start];
}

//QR Code implementation

//Scan results
-(void)readerView:(ZBarReaderView *)readerView didReadSymbols:(ZBarSymbolSet *)symbols fromImage:(UIImage *)image{
    for(ZBarSymbol *sym in symbols){
        QRCode = sym.data;
        break;
    }
}

- (IBAction)btnPageBack_Click:(id)sender {
    [self dismissViewControllerAnimated:YES completion:^{
    }];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(void)dealloc{
    [self.QRCodeReaderView release];
    [_lbPageTitle release];
    [super dealloc];
}
@end
